﻿using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;

namespace Tetris
{
    class TcpServer
    {
        public TcpClient client { get; set; }
        public NetworkStream stream { get; set; }
        public BinaryFormatter formatter { get; set; }

        public TcpServer(String serv, int port)
        {
            this.client = new TcpClient(serv, port);
            this.stream = client.GetStream();
            this.formatter = new BinaryFormatter();
        }
        public void sendGame(Game g)
        {
            this.formatter.Serialize(stream, g);
        }
    }
}
